package com.iwhalecloud.bss.kite.cucc.service.pos.handler.impl;

import java.util.Objects;

import org.springframework.stereotype.Service;

import com.iwhalecloud.bss.kite.cucc.client.dto.pos.KitePosAcceptStaffDTO;
import com.iwhalecloud.bss.kite.cucc.service.pos.handler.IKitePosSceneHandler;
import com.iwhalecloud.bss.kite.cucc.service.pos.handler.KitePosHandlerContext;
import com.ztesoft.bss.common.util.ContextUtil;

@Service
public class KitePosAcceptStaffHandler implements IKitePosSceneHandler {

	@Override
	public void handle(KitePosHandlerContext context) {
		//根据SceneInstId 从缓存获取收单报文
        //KitePosDTO kitePosDto = ExtOrderInfoCache.get(context.getSceneInstId());
        //KitePosAcceptStaffDTO accept = kitePosDto.getAccept();
        //context.getPosDto().setAccept(accept);
		if (Objects.isNull(context.getPosDto().getAccept())) {
			KitePosAcceptStaffDTO accept = new KitePosAcceptStaffDTO();
			accept.setStaffId((String) ContextUtil.getLoginInfo().getUserInfo().getExtParams().get("accountId"));
			accept.setCode((String) ContextUtil.getLoginInfo().getUserInfo().getExtParams().get("account"));
			context.getPosDto().setAccept(accept);
		}
	}

}
